Release 10.1A: OpenEdge Development:
Web Services
Invoking a header handler
The following procedure fragment shows how the 4GL might specify and invoke a header handler for the SOAP message described in the previous sections, in this case returned as a SOAP response message:
This fragment specifies the response header handler for an internal procedure named
TransactionResponseHandlerthat is defined in the current external procedure context. Then, it invokes astartTransactionprocedure as the first operation. As the name and parameters imply, this operation begins a transaction on the order (perhaps automatically retrieved or created, as necessary) with the specified order number.One can imagine that the SOAP response message returned by this operation has a header containing database object and transaction state information for the transaction that was started. Our typical SOAP message contains just such information, including an ID for the order (the
<q1:OrderInfoID>element) and some values identifying the transaction that is managing the order (the<t:Transaction>element).The following internal procedure defines the
TransactionResponseHandlercallback procedure for the header handler. In this case, the handler locates the<uuid>element in theOrderInfoIDheader entry within the SOAP header referenced by the SOAP header object handle parameter,hSOAPHeader:
It then saves the
uuidstring value to anOUTPUTparameter(gcUUID)defined globally in the calling procedure context. This is all accomplished using methods and attributes of the SOAP header object, SOAP header entry object, and x-noderef objects to access the parsed XML DOM tree of the SOAP header.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |